home *** CD-ROM | disk | FTP | other *** search
- global gSize, gCast, gVariable, gFirstColor, gSecondColor, myCurrentImage, myCurrentPreview, g4bitValues
-
- on toolGradientH32
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.width = 0) or (myShape.height = 0) then
- nothing()
- next repeat
- end if
- firstR = gFirstColor.red
- firstG = gFirstColor.green
- firstB = gFirstColor.blue
- secondR = gSecondColor.red
- secondG = gSecondColor.green
- secondB = gSecondColor.blue
- myShapeWidth = myShape.width
- colorSpreadR = abs(firstR - secondR) + 1
- colorSpreadG = abs(firstG - secondG) + 1
- colorSpreadB = abs(firstB - secondB) + 1
- colorStepR = colorSpreadR / float(myShapeWidth)
- colorStepG = colorSpreadG / float(myShapeWidth)
- colorStepB = colorSpreadB / float(myShapeWidth)
- l = myShape.left
- r = l + 1
- cR = firstR
- cG = firstG
- cB = firstB
- repeat while myShapeWidth > 1
- myCurrentImage.fill(rect(l, myShape.top, r, myShape.bottom), [#shapeType: #rect, #lineSize: 0, #color: rgb(cR, cG, cB)])
- myShapeWidth = myShapeWidth - 1
- colorSpreadR = secondR - cR
- colorSpreadG = secondG - cG
- colorSpreadB = secondB - cB
- colorStepR = colorSpreadR / float(myShapeWidth)
- colorStepG = colorSpreadG / float(myShapeWidth)
- colorStepB = colorSpreadB / float(myShapeWidth)
- l = r
- r = l + 1
- cR = cR + colorStepR
- cG = cG + colorStepG
- cB = cB + colorStepB
- end repeat
- myCurrentImage.fill(rect(l, myShape.top, myShape.right, myShape.bottom), [#shapeType: #rect, #lineSize: 0, #color: rgb(cR, cG, cB)])
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-
- on toolGradientV32
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.width = 0) or (myShape.height = 0) then
- nothing()
- next repeat
- end if
- firstR = gFirstColor.red
- firstG = gFirstColor.green
- firstB = gFirstColor.blue
- secondR = gSecondColor.red
- secondG = gSecondColor.green
- secondB = gSecondColor.blue
- myShapeHeight = myShape.height
- colorSpreadR = abs(firstR - secondR) + 1
- colorSpreadG = abs(firstG - secondG) + 1
- colorSpreadB = abs(firstB - secondB) + 1
- colorStepR = colorSpreadR / float(myShapeHeight)
- colorStepG = colorSpreadG / float(myShapeHeight)
- colorStepB = colorSpreadB / float(myShapeHeight)
- t = myShape.top
- b = t + 1
- cR = firstR
- cG = firstG
- cB = firstB
- repeat while myShapeHeight > 1
- myCurrentImage.fill(rect(myShape.left, t, myShape.right, b), [#shapeType: #rect, #lineSize: 0, #color: rgb(cR, cG, cB)])
- myShapeHeight = myShapeHeight - 1
- colorSpreadR = secondR - cR
- colorSpreadG = secondG - cG
- colorSpreadB = secondB - cB
- colorStepR = colorSpreadR / float(myShapeHeight)
- colorStepG = colorSpreadG / float(myShapeHeight)
- colorStepB = colorSpreadB / float(myShapeHeight)
- t = b
- b = t + 1
- cR = cR + colorStepR
- cG = cG + colorStepG
- cB = cB + colorStepB
- end repeat
- myCurrentImage.fill(rect(myShape.left, t, myShape.right, myShape.bottom), [#shapeType: #rect, #lineSize: 0, #color: rgb(cR, cG, cB)])
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-
- on toolGradientOval32
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.height < 3) or (myShape.width < 3) then
- myCurrentImage.fill(myShape, [#shapeType: #oval, #lineSize: 0, #color: gFirstColor])
- next repeat
- end if
- firstR = gFirstColor.red
- firstG = gFirstColor.green
- firstB = gFirstColor.blue
- secondR = gSecondColor.red
- secondG = gSecondColor.green
- secondB = gSecondColor.blue
- myShapeHeight = myShape.height
- myShapeWidth = myShape.width
- colorSpreadR = abs(firstR - secondR) + 1
- colorSpreadG = abs(firstG - secondG) + 1
- colorSpreadB = abs(firstB - secondB) + 1
- colorStepR = ((colorSpreadR / float(myShape.height) * 2) + (colorSpreadR / float(myShape.width) * 2)) / 2
- colorStepG = ((colorSpreadG / float(myShape.height) * 2) + (colorSpreadG / float(myShape.width) * 2)) / 2
- colorStepB = ((colorSpreadB / float(myShape.height) * 2) + (colorSpreadB / float(myShape.width) * 2)) / 2
- l = myShape.left
- t = myShape.top
- r = myShape.right
- b = myShape.bottom
- cR = firstR
- cG = firstG
- cB = firstB
- repeat while (myShapeHeight > 2) and (myShapeWidth > 2)
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #oval, #lineSize: 0, #color: rgb(cR, cG, cB)])
- myShapeHeight = myShapeHeight - 2
- myShapeWidth = myShapeWidth - 2
- colorSpreadR = secondR - cR
- colorSpreadG = secondG - cG
- colorSpreadB = secondB - cB
- colorStepR = ((colorSpreadR / float(myShapeHeight) * 2) + (colorSpreadR / float(myShapeWidth) * 2)) / 2
- colorStepG = ((colorSpreadG / float(myShapeHeight) * 2) + (colorSpreadG / float(myShapeWidth) * 2)) / 2
- colorStepB = ((colorSpreadB / float(myShapeHeight) * 2) + (colorSpreadB / float(myShapeWidth) * 2)) / 2
- l = l + 1
- t = t + 1
- r = r - 1
- b = b - 1
- cR = cR + colorStepR
- cG = cG + colorStepG
- cB = cB + colorStepB
- end repeat
- if (myShapeHeight = 1) and (myShapeWidth = 1) then
- myCurrentImage.setPixel(l, t, gSecondColor)
- else
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #oval, #lineSize: 0, #color: gSecondColor])
- end if
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-
- on toolGradientRect32
- member("state1 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- startX = (the mouseH - sprite(1).left) * 2 / gVariable / 2
- startY = (the mouseV - sprite(1).top) * 2 / gVariable / 2
- myShape = rect(0, 0, 0, 0)
- myStartImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentImage = duplicate(member(gSize & "x" & gSize, gCast).image)
- myCurrentPreview = duplicate(member("preview", gCast).image)
- repeat while the mouseDown
- myCurrentImage.copyPixels(myStartImage, myStartImage.rect, myStartImage.rect)
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, (the mouseV - sprite(1).top) * 2 / gVariable / 2, startX + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) < startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) >= startX) then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if (((the mouseV - sprite(1).top) * 2 / gVariable / 2) >= startY) and (((the mouseH - sprite(1).left) * 2 / gVariable / 2) < startX) then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- if ((the mouseV - sprite(1).top) * 2 / gVariable / 2) = startY then
- myShape = rect(startX, (the mouseV - sprite(1).top) * 2 / gVariable / 2, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, startY + 1)
- else
- if ((the mouseH - sprite(1).left) * 2 / gVariable / 2) = startX then
- myShape = rect((the mouseH - sprite(1).left) * 2 / gVariable / 2, startY, startX + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- else
- myShape = rect(startX, startY, ((the mouseH - sprite(1).left) * 2 / gVariable / 2) + 1, ((the mouseV - sprite(1).top) * 2 / gVariable / 2) + 1)
- end if
- end if
- end if
- end if
- end if
- if (myShape.height < 3) or (myShape.width < 3) then
- myCurrentImage.fill(myShape, [#shapeType: #rect, #lineSize: 0, #color: gFirstColor])
- next repeat
- end if
- firstR = gFirstColor.red
- firstG = gFirstColor.green
- firstB = gFirstColor.blue
- secondR = gSecondColor.red
- secondG = gSecondColor.green
- secondB = gSecondColor.blue
- myShapeHeight = myShape.height
- myShapeWidth = myShape.width
- colorSpreadR = abs(firstR - secondR) + 1
- colorSpreadG = abs(firstG - secondG) + 1
- colorSpreadB = abs(firstB - secondB) + 1
- colorStepR = ((colorSpreadR / float(myShape.height) * 2) + (colorSpreadR / float(myShape.width) * 2)) / 2
- colorStepG = ((colorSpreadG / float(myShape.height) * 2) + (colorSpreadG / float(myShape.width) * 2)) / 2
- colorStepB = ((colorSpreadB / float(myShape.height) * 2) + (colorSpreadB / float(myShape.width) * 2)) / 2
- l = myShape.left
- t = myShape.top
- r = myShape.right
- b = myShape.bottom
- cR = firstR
- cG = firstG
- cB = firstB
- repeat while (myShapeHeight > 2) and (myShapeWidth > 2)
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #rect, #lineSize: 0, #color: rgb(cR, cG, cB)])
- myShapeHeight = myShapeHeight - 2
- myShapeWidth = myShapeWidth - 2
- colorSpreadR = secondR - cR
- colorSpreadG = secondG - cG
- colorSpreadB = secondB - cB
- colorStepR = ((colorSpreadR / float(myShapeHeight) * 2) + (colorSpreadR / float(myShapeWidth) * 2)) / 2
- colorStepG = ((colorSpreadG / float(myShapeHeight) * 2) + (colorSpreadG / float(myShapeWidth) * 2)) / 2
- colorStepB = ((colorSpreadB / float(myShapeHeight) * 2) + (colorSpreadB / float(myShapeWidth) * 2)) / 2
- l = l + 1
- t = t + 1
- r = r - 1
- b = b - 1
- cR = cR + colorStepR
- cG = cG + colorStepG
- cB = cB + colorStepB
- end repeat
- if (myShapeHeight = 1) and (myShapeWidth = 1) then
- myCurrentImage.setPixel(l, t, gSecondColor)
- else
- myCurrentImage.fill(rect(l, t, r, b), [#shapeType: #rect, #lineSize: 0, #color: gSecondColor])
- end if
- member(gSize & "x" & gSize, gCast).image.copyPixels(myCurrentImage, myCurrentImage.rect, myCurrentImage.rect)
- updateStage()
- put myShape.width.abs into field "dimension status W"
- put myShape.height.abs into field "dimension status H"
- fnUpdatePreview()
- end repeat
- sprite(35).pState = 0
- sendSprite(35, #setMember)
- member("state2 - " & gSize, gCast).image = member(gSize & "x" & gSize, gCast).image
- myStartImage = VOID
- myCurrentImage = VOID
- myCurrentPreview = VOID
- put EMPTY into field "dimension status W"
- put EMPTY into field "dimension status H"
- end
-